//
//  orderTableViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/1/22.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "orderTableViewCell.h"
#import <Masonry/Masonry.h>
#import "configddd.h"

@implementation orderTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor=[ZJCModel colorWithString:@"f2f2f2"];
        
        self.backView=[[UIView alloc]initWithFrame:CGRectMake(0,  0, DEF_SCREEN_WIDTH, screenScale(135))];
        self.backView.backgroundColor=[UIColor whiteColor];
        [self addSubview:self.backView];
        
        // 图片
        self.shouImageView=[[UIImageView alloc]initWithFrame:CGRectMake(screenScale(20), screenScale(15), screenScale(105), screenScale(105))];
        self.shouImageView.layer.borderColor=[ZJCModel colorWithString:@"f2f2f2"].CGColor;
        self.shouImageView.layer.borderWidth=(1);
        self.shouImageView.image=[UIImage imageNamed:@"niunai"];
        [self.backView addSubview:self.shouImageView];
        
        //商品名称
        self.nameLable=[[UILabel alloc]init];
//        self.nameLable.text=@"高原野生大花蜜280g";
        self.nameLable.numberOfLines = 0;
        self.nameLable.font = get4sFont(13);
        [self.backView addSubview:self.nameLable];
        [self.nameLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.backView).with.offset(screenScale(30));
            make.left.mas_equalTo(self.backView).with.offset(screenScale(150));
            make.right.mas_equalTo(self.backView).with.offset(screenScale(-150));
            
        }];
        
        //商品价格
        self.priceLable = [[UILabel alloc]init];
        self.priceLable.font = get4sFont(13);
        self.priceLable.textAlignment = NSTextAlignmentRight;
//        self.priceLable.text=@"￥19.9";
        [self.backView addSubview:self.priceLable];
        [self.priceLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.backView).with.offset(screenScale(30));
            make.right.mas_equalTo(self.backView).with.offset(screenScale(-30));
            
            make.height.mas_equalTo(screenScale(28));
        }];
        
        //数量
        self.numLable=[[UILabel alloc]init];
        self.numLable.text=@"×1";
        self.numLable.font = get4sFont(13);
        self.numLable.textAlignment=NSTextAlignmentRight;
        self.numLable.textColor=[UIColor lightGrayColor];
        [self.backView addSubview:self.numLable];
        
        [self.numLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.backView).with.offset(screenScale(75));
            make.right.mas_equalTo(self.backView).with.offset(screenScale(-30));
            
            make.height.mas_equalTo(screenScale(28));
        }];
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
